home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------------------
- File: ScriptRunnerAgentInit.cpp
-
- Contains: CFM Initialization routine
-
- Written by: Sue Dumont
-
- Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- ------------------------------------------------------------------------------*/
-
- // -- Compiler/Preprocessor Switches --
-
- #ifndef _COMPILERDEFS_
- #include "CompDefs.h"
- #endif
-
- // -- OpenDoc Utilities --
-
- #ifndef _EXCEPT_
- // Exceptions define several important macros (eg. CHECKENV)
- // which are used in the SOM method dispatch glue. If Except.h
- // is not included early enough, exceptions may not be thrown
- // correctly when returning from a SOM method with "ev" parameter set.
- #include <Except.h>
- #endif
-
- #ifndef _ODMEMORY_
- #include <ODMemory.h>
- #endif
-
- #ifndef __USERSRCM__
- #include <UseRsrcM.h>
- #endif
-
- // -- MacToolbox Includes --
-
- #ifndef __CODEFRAGMENTS__
- #include <CodeFragments.h>
- #endif
-
-
- #ifdef applec
- #pragma segment ScriptRunnerAgentCFMInit
- #endif
-
-
- //------------------------------------------------------------------------------
- // Prototypes
- //------------------------------------------------------------------------------
-
- extern "C" pascal OSErr ScriptRunnerAgentCFMInit(CFragInitBlockPtr initBlkPtr);
-
- //------------------------------------------------------------------------------
- // OSAPlugInCFMInit Function
- //------------------------------------------------------------------------------
-
- extern "C" pascal OSErr ScriptRunnerAgentCFMInit(CFragInitBlockPtr initBlkPtr)
- {
- OSErr err1, err2;
-
- // We are using OpenDoc's memory management calls, so we
- // must initialize the interface to the memory manager.
- err1 = InitODMemory();
-
- if ( !err1 )
- {
- // We must also capture the relevant information about
- // our library file so that we may access our resources.
- err2 = InitLibraryResources(initBlkPtr);
- }
- return (OSErr) (err1 != noErr) ? err1 : err2;
- }
-